﻿using System.Linq;
using cludg.Domain.Environment;

namespace cludg.Services.Environment
{
	public interface ISettingService
	{
		IQueryable<Setting> All { get; }
		void SetGlobal(string name, object value, string description = "");
		void SetUser(string name, object value, string userId, string description = "");
		object GetGlobal(string name);
		object GetUser(string name, string userId);
		void DeleteGlobal(string name);
		void DeleteUser(string name, string userId);

		/// <summary>
		/// Global setting value
		/// </summary>
		/// <param name="name">Setting Name</param>
		/// <returns>Setting value</returns>
		object this[string name] { get; set; }
		/// <summary>
		/// User setting value
		/// </summary>
		/// <param name="name">Setting name</param>
		/// <param name="userId">User id</param>
		/// <returns>Setting value</returns>
		object this[string name, string userId] { get; set; }
	}
}
